//
//  Waypoint.m
//  GeoData
//
//  Created by zhenhua zhou on 12-7-7.
//  Copyright (c) 2012年 ECUST. All rights reserved.
//

#import "Waypoint.h"

@implementation Waypoint

@synthesize StartPoint,EndPoint, Distance, Duration, PointsData, Description, DistanceStr, DurationStr;

- (Waypoint *) init
{
    self = [super init];
    if(self)
    {
        if(StartPoint==nil)
        {
            StartPoint = [[GeoPos alloc] init];
        }
        
        if(EndPoint==nil)
        {
            EndPoint = [[GeoPos alloc] init];
        }
        
        if(Description == nil)
        {
            Description = [[NSString alloc] init];
        }
        
        if(Distance == nil)
        {
            Distance = [[NSNumber alloc]init];
        }
        if(Duration ==nil)
        {
            Duration = [[NSNumber alloc]init];
        }
        
        if(PointsData == nil)
        {
            PointsData = [[NSString alloc] init];
        }
        
        if(DistanceStr== nil)
        {
            DistanceStr = [[NSString alloc] init];
        }
        
        if(DurationStr==nil)
        {
            DurationStr = [[NSString alloc] init];
        }
    }
    
    return self;
}

- (void)dealloc
{
    if(StartPoint)
    {
        [StartPoint dealloc];
    }
    
    if(EndPoint)
    {
        [EndPoint dealloc];
    }
    
    if(Description)
    {
        [Description dealloc];
    }
    
    if(Distance)
    {
        [Distance dealloc];
    }

    
    if(Duration)
    {
        [Duration dealloc];
    }
    
    if(PointsData)
    {
        [PointsData dealloc];
    }    
    
    if(DistanceStr)
    {
        [DistanceStr dealloc];
    }
    
    if(DurationStr)
    {
        [DurationStr dealloc];
    }

    
    [super dealloc];
}

@end
